home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 146
/
(Vol 146) Jan 07 2012.iso
/
Games
/
scuba.swf
/
scripts
/
frame_1
/
DoAction_2.as
next >
Wrap
Text File
|
2012-01-07
|
3KB
|
101 lines
function fnSetConstants()
{
TOTAL_BG_LENGTH = Number(coral._width);
INTERFACE_WIDTH = Number(560);
SPEED = Number(4);
FISH_SPEED = Number(7);
FISH_ACCEL = Number(FISH_SPEED - SPEED);
INTERFACE_CENTER_X = Number(280 + Number(177));
FULL_OXYGEN = Number(26);
BG_START_POSITION = Number(coral._x);
BG_LEFT_LIMIT = Number(INTERFACE_CENTER_X - Number(Number(TOTAL_BG_LENGTH / 2) - Number(INTERFACE_WIDTH / 2)));
BG_RIGHT_LIMIT = Number(INTERFACE_CENTER_X + Number(Number(TOTAL_BG_LENGTH / 2) - Number(INTERFACE_WIDTH / 2)));
WALL_PENALTY = Number(3);
CREATURE_PENALTY = Number(3);
VERT_FACTOR = Number(16);
LEFT_BOUND = Number(177);
RIGHT_BOUND = LEFT_BOUND + Number(INTERFACE_WIDTH);
TOP_BOUND = Number(67);
BOTTOM_BOUND = Number(327);
TANK_REFILL = Number(10);
POINTS_FOR_MINE_cadet = Number(10);
POINTS_FOR_MINE_commando = Number(15);
SAFETY_DIFF = Number(28);
LOW_OXYGEN = Number(10);
}
function fnGetRoot(mySWF)
{
var vfullpath = _url;
var vtrimloc = vfullpath.indexOf(mySWF);
SITEROOT = vfullpath.substring(0,vtrimloc);
}
function fnPauseGame()
{
gPaused = true;
if(gRecruitStatus == "hit" || gRecruitStatus == "recovering" && _currentframe != 18)
{
recruitResetFrame = Number(recruit._currentframe);
}
timer.gotoAndStop("base");
scrollerClip.gotoAndStop("base");
oxygenLauncher.gotoAndStop("base");
fishLauncher.gotoAndStop("base");
mineLauncher.gotoAndStop("base");
gProdFrame = recruit.vProdFrame;
if(gProdFrame == undefined && gProdStatus != "activated")
{
gProdFrame = Number(1);
}
gJumpLoc = true;
recruitResetX = recruit._x;
recruitResetY = recruit._y;
coralResetX = coral._x;
i = 0;
while(i < activeTanks.length)
{
set(activeTanks[i] + "ResetX",eval(activeTanks[i] + "._x"));
set(activeTanks[i] + "ResetY",eval(activeTanks[i] + "._y"));
setProperty(activeTanks[i], _visible, 0);
i++;
}
i = 0;
while(i < activeMines.length)
{
set(activeMines[i] + "ResetX",eval(activeMines[i] + "._x"));
set(activeMines[i] + "ResetY",eval(activeMines[i] + "._y"));
setProperty(activeMines[i], _visible, 0);
i++;
}
i = 0;
while(i < activeFishies.length)
{
set(activeFishies[i] + "ResetX",eval(activeFishies[i] + "._x"));
set(activeFishies[i] + "ResetY",eval(activeFishies[i] + "._y"));
setProperty(activeFishies[i], _visible, 0);
i++;
}
}
function fnViewBriefing()
{
if(gInGame == true)
{
if(gPaused == false)
{
fnPauseGame();
}
}
else if(endClip._currentframe == 1 || endClip._currentframe == undefined)
{
gResumeFrame = null;
}
else if(gScore >= 200)
{
gResumeFrame = "passend";
}
else
{
gResumeFrame = "nopassend";
}
gotoAndStop(28);
}